home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Interactive 7
/
PC World Interactive 7.iso
/
program
/
ctutord.EXE
/
77A.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-09-17
|
580b
|
32 lines
/*
There may be additional include files required depending
upon the compile product you are using. Typical compilers
include Microsoft C by Microsoft or Turbo C by Boland Int'l.
*/
#include <stdio.h>
#define ON 1
#define OFF 0
#define TRUE 7
struct flag{
unsigned int pflag:1;
unsigned int sflag:1;
unsigned int jflag:3;
} type;
main()
{
type.pflag = ON;
type.sflag = OFF;
type.jflag = TRUE;
if(type.pflag)
printf("flag is ON\n");
else
printf("flag is OFF\n");
type.pflag = 7;
printf("%d\n",type.pflag); /* will print 1 */
}